package com.zhc.validate.entity;

import lombok.Data;

@Data
public class Range {
    private long min;
    private long max;

    public Range(long min, long max) {
        this.min = min;
        this.max = max;
    }

    /**
     * 获取范围随机值
     * @param range   范围
     * @return 随机值
     */
    public static long getValueMinToMax(Range range) {
        return (long) (Math.random() * (range.getMax() - range.getMin()) + range.getMin());
    }


}
